package com.bestcem.xm.txtanls.dao.mapper;

import com.bestcem.xm.txtanls.entity.mysql.HiddenKeywordEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 关键词相关DAO
 *
 * @author jie.yao <jie.yao@idiaoyan.com>
 * @version v1.0
 * @date 2021/9/27 14:03
 */
@Mapper
public interface HiddenKeywordMapper {

    /**
     * 查询屏蔽关键词
     *
     * @param projectId 项目id
     * @return 屏蔽关键词
     * @author jie.yao <jie.yao@idiaoyan.com>
     * @date 2021/9/27 14:05
     */
    List<HiddenKeywordEntity> listById(@Param("projectId") String projectId);

    /**
     * <p>话题添加关键词</p>
     *
     * @param hiddenKeywordEntity 关键词entity
     * @return 插入成功条数
     * @author jie.yao <jie.yao@idiaoyan.com>
     * @date 2021/9/27 14:05
     */
    Integer insert(HiddenKeywordEntity hiddenKeywordEntity);

    /**
     * 删除屏蔽关键词
     *
     * @param projectId 项目id
     * @param keyword   关键词
     * @return 删除成功条数
     * @author jie.yao <jie.yao@idiaoyan.com>
     * @date 2021/9/27 14:05
     */
    Integer deleteByProjectIdAndKeyword(@Param("projectId") String projectId, @Param("keyword") String keyword);


    /**
     * <p>话题批量添加关键词</p>
     *
     * @param hiddenKeywordEntityList 关键词entity列表
     * @return 批量插入成功条数
     * @author jie.yao <jie.yao@idiaoyan.com>
     * @date 2021/9/27 14:05
     */
    Integer insertKeywords(@Param("hiddenKeywordEntityList") List<HiddenKeywordEntity> hiddenKeywordEntityList);

    /**
     * 删除分析项目下的全部隐藏关键词信息
     *
     * @param projectId 项目id
     * @return 删除成功条数
     * @author jie.yao <jie.yao@idiaoyan.com>
     * @date 2021/9/27 14:05
     */
    Integer deleteByProjectId(@Param("projectId") String projectId);
}
